How to split a string in balanced strings leetcode

visit shbcf.ru